﻿namespace EFCoreLock.Config;

public class WorkConfig : IEntityTypeConfiguration<Work>
{
    public void Configure(EntityTypeBuilder<Work> builder)
    {
        builder.ToTable("T_Work").ToTable(p=>p.HasComment("工作表")).HasKey(p=>p.Id);
        builder.HasOne(p => p.Employee).WithOne(p => p.Work).HasForeignKey<Work>(p => p.EmployeeId);
        builder.Property(p => p.Content).HasMaxLength(100).HasComment("工作内容");
    }
}
